how do I display the gridlines in a HTML table? (am using IE6)
HTML / CSS table with GRIDLINES
Via css. Put this inside the <head>
tag.
<style type="text/css" media="screen">
table{
border-collapse:collapse;
border:1px solid #FF0000;
}
table td{
border:1px solid #FF0000;
}
</style>
Use <style type="text/css"> instead. –
Outnumber
the border-collapse on tds is superfluous (and in fact not standard). –
Brio
one more question - how do I make the vertical lines solid, and the horizontal lines dashed? –
Ralph
border-left: 1px solid black; border-right:1px solid black; border-bottom:1px dotted black ( or dashed) –
Distributary
Useful for figuring out layout problems! –
Rundgren
<table border="1"></table>
should do the trick.
Should work, but it's better to separate content and design (content in html, design in css, where border is design. –
Outnumber
Agreed, but sometimes it's ok to bend the rules a little too :) –
Deutoplasm
This is great for troubleshooting when using colspan a lot. Being able to add or remove border='1' is much simpler than messing with css. –
Montmartre
This only displays a border around the table, right? So there's no distinction between columns and rows. –
Kimberleekimberley
@EricDuminil this is a very old answer and browsers may render differently these days. Back then most (all?) browsers would cascade the property to table elements. –
Deutoplasm
For internal gridlines, use the tag: td For external gridlines, use the tag: table
© 2022 - 2024 — McMap. All rights reserved.