Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Design HTML Email Design Coding HTML Email Coding with Limited HTML

Will Lam
Will Lam
7,027 Points

How did you guys automatically close the <tr> and <td>, <table> tag etc in Sublime Text?

It was rather abrupt, but I couldn't catch what Fabio did. That would save a ton of time if we knew how to do that (and avoid errors as well)

Nkosi Ndlovu
Nkosi Ndlovu
9,652 Points

Haven't seen the video but I'm assuming it's the auto completion you are talking about. If it is, then you might want to look into Emmet http://emmet.io/

2 Answers

James Ingmire
James Ingmire
11,901 Points

You have to save the file first as 'example.html' or 'example.css' or what ever language you're writing and then when you start to enter </ the closing tag will auto fill.

It is the auto completion feature in Sublime text. Be sure to do this:

  1. You must save the new file you have opened as the file type you are gonna work with (.css for CSS, .html or .php for HTML & PHP, etc.). If you have opened an existing file, be sure that the Language that Sublime Text is trying to read is the same as the file's. You can check which language the programm is using from the menu View->Syntax.

  2. If the issue wasn't soved from that, check if your auto complete feature is turned on. You can open the settings from Preferences->Settings (Default or User), go to line 214 and it should look something like this:

     // Enable auto complete to be triggered automatically when typing.
    "auto_complete": true,

    // The maximum file size where auto complete will be automatically triggered.
    "auto_complete_size_limit": 4194304,

    // The delay, in ms, before the auto complete window is shown after typing
    "auto_complete_delay": 50,

    // Controls what scopes auto complete will be triggered in
    "auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

    // Additional situations to trigger auto complete
    "auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],

    // By default, auto complete will commit the current completion on enter.
    // This setting can be used to make it complete on tab instead.
    // Completing on tab is generally a superior option, as it removes
    // ambiguity between committing the completion and inserting a newline.
    "auto_complete_commit_on_tab": false,

    // Controls if auto complete is shown when snippet fields are active.
    // Only relevant if auto_complete_commit_on_tab is true.
    "auto_complete_with_fields": false,

    // Automatically close HTML and XML tags when </ is entered.
    "auto_close_tags": true,

Don't just copy and paste it in because something might go wrong. See if these settings are matching with yours first.