+ 11

HTML HELP

how do i make a button output a table? after clicking a button this table will appear. Thanks so muchhh <html> <head>   <title>Tabel</title>   </head> <body>   <table align="center" style="font-size:35" bgcolor="lightpink" cellpadding="15" cellspacing="5" border="1">     <tr>       <td>31</td>       <td>18</td>       <td>27</td> <td>23</td>       </tr>     <tr>       <td>17</td>       <td>24</td>       <td>29</td>       <td>22</td>      

20th Aug 2017, 2:44 PM
RKJ 🌹
RKJ 🌹 - avatar
12 odpowiedzi
+ 7
Yeah it will really need a JS codes.
21st Aug 2017, 3:06 AM
¤ rookie ¤
¤ rookie ¤ - avatar
+ 3
you have to add a custom id to your table tag and display the table none, then you need a js function and a button for display the table. you can try below code... YOUR HTML CODE... <!DOCTYPE html> <html> <head> <title>Tabel</title> </head> <body> <table id="demo" align="center" style="font-size:35;display:none;" bgcolor="lightpink" cellpadding="15" cellspacing="5" border="1"> <tr> <td>31</td> <td>18</td> <td>27</td> <td>23</td> </tr> <tr> <td>17</td> <td>24</td> <td>29</td> <td>22</td> </tr> </table> <button type="button" onclick="table()">Click Me</button> </body> </html> YOUR JAVASCRIPT CODE.... function table(){ document.getElementById("demo").style.display ="block"; }
23rd Aug 2017, 12:38 AM
Rateb
Rateb - avatar
+ 2
It... Will surely need js.
21st Aug 2017, 3:24 AM
itsnameless.dev
itsnameless.dev - avatar
+ 2
Put it in a div container and make it display none in css then show it when ur button is active using active selector in css other wise u need js to show it using onclick!
21st Aug 2017, 6:08 AM
Ahmad Gamal Fath-Allah
Ahmad Gamal Fath-Allah - avatar
+ 1
I expect it will need JavaScript. Keep the table colour white by default. On clicking the button, call a function that will make the table become black or any other colour. I can't give you a code, coz I am weak in JavaScript...
20th Aug 2017, 2:50 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 1
As many have already stated, to make a table appear when you click a button you have to learn JavaScript. JS is used more often to handle HTML events.
21st Aug 2017, 4:26 AM
Learnsolo
+ 1
First give an id attribute to that table next make a function in javascript that changes the display value of the table to none or block and you are ready
21st Aug 2017, 9:08 AM
darkorbit17493
0
You need js code to output the table. and form onclick event Html code
21st Aug 2017, 8:15 AM
Anita Rosaire
Anita Rosaire - avatar
0
It's more easier using Javascript libraries like jQuery
21st Aug 2017, 7:15 PM
Okereke Samuel O.
Okereke Samuel O. - avatar
0
<!DOCTYPE html> <html> <head> <title>Page Title</title> <button onclick="T()">Show</button> </head> <body> <table border="2px" id="demo1" style="display:none"> <tr> <td> 31 </td> <td> 18 </td> <td>27</td> <td>23</td> </tr> <tr> <td>17</td> <td>24</td> <td>29</td> <td>22</td> </tr> </table> <script> function T() { document.getElementById("demo1").style.display="block"; } </script> </body> </html>
22nd Aug 2017, 10:44 PM
Joyanta paul
Joyanta paul - avatar
0
я не могу ответит на вопрос 1 вопрос 2там кароче я изучу HTML на Lo???
23rd Aug 2017, 7:29 AM
Abror Xakimov
Abror Xakimov - avatar
- 1
use js or jquery.
21st Aug 2017, 6:00 AM
Minerva
Minerva - avatar