I would like to use the CSS equivalent of border="1"
through an equivalent stylesheet definition.
The border-width
and border-style
applies for the table but the cell borders which are given by border="1"
are missing out.
I would like to use the CSS equivalent of border="1"
through an equivalent stylesheet definition.
The border-width
and border-style
applies for the table but the cell borders which are given by border="1"
are missing out.
So this should be an easy answer but when you use CSS table and td its doesn't quite match border="1" 100% (But its very close)
My way uses this:
table {
border: 1px outset grey;
padding: 1px
}
td {
border: thin inset grey;
margin: 1;
}
Apply it to the td
elements instead of table
element.
CSS
td { border: solid 1px #PlaceColorHere }
This works for me:
table {
border-width: 2px;
border-style: groove;
}
td {
border-width: 2px;
border-style: inset;
}
If you have some tables which want internal borders and some which don't, to differentiate, create a class "border1". The html changes to :
<table class="border1">
and add css :
.border1, .border1 th, .border1 td
{
border: 1px solid black
}
which creates a border for the table as well as the cells inside.
border-collapse: collapse;
© 2022 - 2024 — McMap. All rights reserved.