Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blocks of pixels

Status
Not open for further replies.

bigairguy

Programmer
May 10, 2005
14
US
I don't know if I'm in the correct place or not. What I'm trying to do is create a page that is divided into pixel blocks that resemble a grid, with each block being 10 pixels wide by 10 pixels high. I'm stumped and I've tried frames, tables, etc. It seems like it really should not be that difficult. Any ideas on how to accomplish this? Do I need to write a script to do this?

Thanks a bunch in advance,
Pat
 
Maybe a large table would do it for you? Maybe a grid of DIVs instead. You could easily clone some elements on the page using Javascript (and them place them over the page into a grid) - but I imagine you would be just as happy with a table.

You might need to think about how to handle the borders of this grid. 10px by 10px - including the borders - or not?

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
This would be best handled server side but since we have no clue what you might be using for a SSL, I'll provide a javascript solution:
Code:
<html>
<head>
<style type="text/css">

table {
   background-color:#000000;
}

td {
   background-color:#ffffff;
   width:10px;
   height:10px;
}

</style>
</head>
<body>

<table cellspacing="1" border="0" cellspacing="0">
   <script type="text/javascript">
      for (i = 0; i < 59; i++) {
         document.write("<tr>");
         for (j = 0; j < 60; j++) {
            document.write("<td></td>");
         }
         document.write("</tr>");
      }
   </script>
</table>

</body>
</html>

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top