Jump to content
Fórum Script Brasil
  • 0

matriz de imagem



<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<body bgcolor="999999">
        <div id="image">
            <a href="javascript:image(linhas,colunas,matriz);">
                Clique aqui para inserir a grade

    var linhas = 2;
    var colunas = 3;
    var matriz = new Array(colunas);
    for (var i = 0; i < colunas; i++)
    matriz[i] = new Array(linhas);

    function image(linhas,colunas) {
        for(var i = 0; i < linhas; i++){
            for(var j = 0;j < colunas; j++){
                matriz[i][j] = document.createElement("IMG");
                matriz[i][j].src = "balao.png";
    function pula_linha(){
        document.getElementById("divExibir").innerHTML = "<br>";

        width: 100px; 
        background: gold;
        word-wrap: break-word;

Estou precisando criar uma matriz de imagem mas quando insiro ela em uma div ela fica horizontal, ex:

está ficando assim

0 0 0 0 0 0 

queria que ficasse assim

0 0 0

0 0 0


Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...