I need to have two columns evenly spaced. I don’t want to use tables for this. Other than putting in the right number of <sp> codes in every line, is there a way I can just insert something that approximates a tab?
If you don’t want to use tables, another option is to create a transparent GIF and insert it between the columns. Make the GIF one pixel in size, and use height and width tags to stretch it to the size you want.
For simple text that you’re content to have appear in constant-width font, tabs are honored inside of <PRE>, though you are at the mercy of the stops set by the browser. If your objection to tables is perceived difficulty, I would agree, just use the table. If you have other objections to the tables, like you are already nested enough tables deep that another one will make Netscape perform badly, you have my sympathies.
Because I want a border between the first and second cell, but I don’t want a border between column AA and column BB, and I don’t think you can selectively turn the border on and off.
There’s an extra table since I like borders with colors and border colors aren’t NS compliant. This should do it though.
Note that since I’m using a different table for each row of data (the AAAAAAAs and BBBBBBs) that if the string for A is longer/shorter than the length of the string for C that the columns won’t be the same width. If this is an issue, let me know and I’ll fix it. This is my quick fix though.
Damn, the board takes out all of my indenting. That’s ugly, and I apologize. There’s one variant of the code that’ll use plain (and ugly) browser borders. Just set the border in the second table to 1 and take out the first two and last two lines of code. This’ll speed it up ever so slightly in Netscape.
I just thought up a variant that will get rid of the column width issue I mentioned before. It gets rid of cellpadding in the process though, so it may not be as pretty as you want.
Geez! Thank you! You saved me hours of figuring out how to embed a table.
I have one question: what controls the height of the first cell? I’d have thought it was linked to the height of the second cell, but it doesn’t seem to be. I’m ending up with something that looks like this:
I thought putting some <br>s before and after the “1” would solve the problem, but it still doesn’t line up the horizontal bar at the bottom of cell 1 and cell two (although it helps). Any way to force the vertical height of cell one to match the vertical height of cell two?
And, thanks again. I’m learning a ton and I really appreciate the help!
One other question: Why “spacer.gif”? I don’t understand how it’s working, since I don’t have a spacer.gif on my system. I tried changing the name and it still worked, so I assume it’s just a way to trick the table into putting in a fixed-size blank spaces, but why aren’t we getting a “file not found” error? I see what it’s doing but I don’t understand why it’s working.
Hm, what’s controlling the height of the columns? Nothing, because I’m a damn fool. (That’s what I get for testing things on only 2 lines of data.) I’ll need to work on that, but for now you’ll have to use my first example. Like I said, if all the columns are going to be of the same width, it shouldn’t matter. Otherwise, well, I’ll figure something out in the next few minutes (hopefully).
As for spacer.gif, it’s the filename usually given to the transparent gif MWI was talking about. I believe it doesn’t return a file not found (which, for graphics, would be the red X looking thing) since it’s too small to really show. FTR, you should have a 1x1 transparent gif made just in case. (I can email you one if you need it.)
Well, Fenris it’s been a long day, so the best advice I can come up with now is to use my original chunk of code, with the single alteration of changing the <td> cells for the cells with data in them to <td valign=“top”>. This will bring all the numbers to the top which should be better if one column will have more info than the column next to it.