- Nov 2, 1999
- 4,821
- 0
- 0
document.getElementById('gallery').style.display = 'block';
Is there anyway to add code in there to center my object? From what I understand, the above replaces id=gallery style to display=block, right?
Originally, I have the following html code -
<table style="width: 790px; text-align: center; margin-left: auto; margin-right: auto; background-color: rgb(165, 154, 132);" cellspacing="7">
All the table items are centered but when add the id=gallery, everything is left aligned --
<table style="width: 790px; text-align: center; margin-left: auto; margin-right: auto; background-color: rgb(165, 154, 132);" id="gallery" cellspacing="7">
In my css, I have
table#gallery
{
margin-left: auto;
margin-right: auto;
display:none;
}
The javascript is suppose to switch it from display:none to block right? It works but all my cell contents are still left aligned, instead of centered.
Any suggestions is greatly greatly appreciated, I've tried everything possible and I'm a css/js noob
Is there anyway to add code in there to center my object? From what I understand, the above replaces id=gallery style to display=block, right?
Originally, I have the following html code -
<table style="width: 790px; text-align: center; margin-left: auto; margin-right: auto; background-color: rgb(165, 154, 132);" cellspacing="7">
All the table items are centered but when add the id=gallery, everything is left aligned --
<table style="width: 790px; text-align: center; margin-left: auto; margin-right: auto; background-color: rgb(165, 154, 132);" id="gallery" cellspacing="7">
In my css, I have
table#gallery
{
margin-left: auto;
margin-right: auto;
display:none;
}
The javascript is suppose to switch it from display:none to block right? It works but all my cell contents are still left aligned, instead of centered.
Any suggestions is greatly greatly appreciated, I've tried everything possible and I'm a css/js noob