-5

Why we use <div> tag if same things can be done in <table> tag?

Is it used to separate all the contents of the page like content, menu, header, footer?

BackSlash
  • 21,927
  • 22
  • 96
  • 136
HENCE PROVED
  • 185
  • 1
  • 3
  • 9
  • 8
    Is Google down again? – Robby Cornelissen Aug 15 '14 at 15:44
  • 2
    divs are block line elements. They are often used as containers for CSS alignment and styling, and can provide a nice break. However, Robby is right. This is easily googleable and I'm not sure how JSP fits in here. – Sterling Archer Aug 15 '14 at 15:47
  • You should read more about *what* is HTML and then ask yourself the same thing about JSP (and *why* introducing a new view technology in your project). But don't go too fast or you'll end up asking this kind of question. Take your time :) – m4rtin Aug 15 '14 at 15:47

1 Answers1

1

Question in title:

What is the significance of using a <div> tag in JSP?

<div> is html. JSP is html (including css, javascript and other resources like images) + Java server side elements:

The former provides static content while the latter provides dynamic content in the produced web page. You combine both to get a well formed fancy web page to show to your users.


Questions in body of the post:

Why we use <div> tag if same things can be done in <table> tag?

No need to reinvent the wheel. It is answered here: Actual table Vs. Div table

Is it used to separate all the contents of the page like content, menu, header, footer?

Since HTML 5 you use <article> (content), <menuitem> (menu), <header> (header), <footer> (footer) instead of lot of <div>s. Still, you can keep using <div> for these purposes. More info: HTML5 New Elements

Community
  • 1
  • 1
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332